<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../../../attr.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="${ctx}/css/sapar.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/common.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/kkpager_blue.css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/sapar.js"></script>
<script type="text/javascript" src="${ctx}/js/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/js/kkpager.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/laydate/laydate.js"></script>
<script type="text/javascript" src="${ctx}/js/mask.js"></script>
<title>BD测试查询</title>
<style type="text/css">   
th{
text-align: center;
}
td{
text-align: center;
}
</style>

</head>
<body>
<div id="mask" class="mask"></div>
<div id="left">
	<div id="saper-container">
        <div id="saper-bd">
            <div class="subfiled clearfix">
                <h2>BD测试查询</h2>
            </div>
            <div class="search-box clearfix">
                <div class="subfiled-content">
                    <div class="kv-item clearfix">
                        <%-- <div class="kv-item-content">
                            <span>查询条件:</span>
                        	<input type="text" id="sousuotiaojian" name="sousuotiaojian" placeholder="包名称/灭菌人/灭菌设备/灭菌流水" value="${tiaojian }"  onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
                        </div> --%>
                        <!-- <label>审核时间：</label> -->
                        <div class="kv-item-content">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <span>起始时间:</span>
                        	<input type="text" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" id="st" name="startTime" value="<fmt:formatDate value='${st}' type='date' pattern='yyyy-MM-dd HH:mm:ss'/>" placeholder="起始时间" readonly="readonly">
                        	<span>终止时间:</span>
                        	<input type="text" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" id="et" name="endTime"  value="<fmt:formatDate value='${et}' type='date' pattern='yyyy-MM-dd HH:mm:ss'/>" placeholder="终止时间"  readonly="readonly">
                        </div>
                    </div>
                    <div class="kv-item clearfix">
                    </div>
                    <a href="javascript:;" class="sapar-btn sapar-btn-recom query-btn" id="chaxun">查询</a>
                </div>
            <div class="subfiled-content">
                <!--表格开始-->
                <form action="" id="ceshiJieshu">
                <div id="table_left" class="table">
                    <!--表格具体内容-->
                    <div class="table-box">
                        <table>
                            <thead>
                                <tr>
                                    <th>测试流水</th>
                                    <th>测试机器</th>
                                    <th>测试软件</th>
                                    <th>测试人名称</th>
                                    <th>测试开始时间</th>
                                    <th>测试结束时间</th>
                                    <th>是否合格</th>
                                </tr>
                            </thead>
                            <tbody>
                                <c:if test="${lstCeshi != null}">
									<!-- var 是给给他起名字 -->
									<c:forEach items="${lstCeshi}" var="ceshi">
										<tr class="ceshiData">
											<td>${ceshi.ceshiLiushui }</td>
											<td>${ceshi.equip.equipName}</td>
											<td>${ceshi.ceshiSoft}</td>
											<td>${ceshi.employee.employeeName}</td>
											<td><fmt:formatDate value="${ceshi.ceshiKaishiTime}" type="date" pattern="yyyy-MM-dd HH:mm:ss" /></td>
											<td><fmt:formatDate value="${ceshi.ceshiJieshuTime}" type="date" pattern="yyyy-MM-dd HH:mm:ss" /></td>
										    <td>
										         <c:if test="${ceshi.ceshiHege ==1 }">合格</c:if>
										         <c:if test="${ceshi.ceshiHege !=1 }">不合格</c:if>
										    </td>
										</tr>
									</c:forEach>
								</c:if>
                            </tbody>
                        </table>
                    </div>
                </div><!--表格结束-->
                </form>
	        </div>
	        </div>
         </div>
	</div>
</div>
        <div id="saper-ft">
        	<div id="kkpager"></div>
        </div>
<script type="text/javascript">
function getParameter(name) { 
	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r!=null) return unescape(r[2]); return null;
}
		
$(function(){
	var startTime=$("#st").val();  
    var endTime=$("#et").val();
	var totalPage = ${total};
   	var pageNo = getParameter('pageIndex');
   	if(!pageNo){
   		pageNo = 1;
   	}
   	kkpager.generPageHtml({
   		pno : pageNo,
   		//总页码
   		total : totalPage,
   		//链接前部
   		hrefFormer : '${ctx}/miejun/findCeshi',
   		//链接尾部
   		hrefLatter : '.do',
   		getLink : function(n){
   			return this.hrefFormer + this.hrefLatter + "?pageIndex="+n+"&searchTxt="+$(".search_text").val()+"&startTime="+startTime+"&endTime="+endTime;
   		}
   	});
   	
   	$("#chaxun").click(function(){
   		starttime=$("#st").val();
		endtime=$("#et").val();
        var start=new Date(starttime.replace("-", "/").replace("-", "/"));  
        var end=new Date(endtime.replace("-", "/").replace("-", "/"));  
        if(end<start){  
           alert("终止时间不能在起始时间之前");  
        } 
	    window.location.href = "${ctx}/miejun/findCeshi.do?startTime="+starttime+"&endTime="+endtime;
   	});
});
</script>
</body>
</html>